package com.ls.smartcampus2.controller;

import com.ls.smartcampus2.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dell
 */
@RestController
public class StudentController {
    @Autowired
    private StudentService studentService;
    @PostMapping("/queryPwdById")
    public String queryPwdById(String sid,String pwd){
        //s为学号
        System.out.println(sid);
        System.out.println(pwd);
        String rPwd = studentService.queryPwdById(sid);
        if(rPwd==null){
            return "0";
        }else
        if(rPwd.equals(pwd)){
            //表示密码正确
            return "1";
        }
        else {
            return "0";
        }
        ////表示密码错误




    }

    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }
}
